#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main()
{
    int player, computer;
    char choices[3][10] = {"stone", "clipper", "cloth"};

    srand(time(NULL));

    while (1)
    {
        printf("please choose：\n");
        printf("0. stone\n");
        printf("1. clipper\n");
        printf("2. cloth\n");

        scanf("%d", &player);
        computer = rand() % 3;

        printf("your choice：%s\n", choices[player]);
        printf("computer choice：%s\n", choices[computer]);

        if (player == computer)
        {
            printf("draw！\n");
        }
        else if ((player == 1 && computer == 2) || (player == 2 && computer == 0) || (player == 0 && computer == 1))
        {
            printf("victort！\n");
        }
        else
        {
            printf("fail！\n");
        }
    }

    return 0;
}
